<html>
<head>
    <meta charset="utf-8">
    <style type="text/css">
        body {

            background-image: url('./beijing.png');


        }
    </style>
</head>
<body>


<?php
$lng = $_GET['jing'];
$lat = $_GET['wei'];

$config = parse_ini_file("config/db_config.ini");
$server = $config["server"];
$username = $config["username"];
$password = $config["password"];
$database = $config["database"];
$link = mysqli_connect($server, $username, $password, $database);


$sql = "SELECT * FROM typhoon_total WHERE flat=0 and num in (SELECT DISTINCT num FROM typhoon_detail where lat between " . ($lat - 1) . " and " . ($lat + 1) . " and `long` between " . ($lng - 1) . " and " . ($lng + 1) . " ORDER BY num);";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_row($result);


echo '<center><table border="1" cellspacing="0px" cellpadding="2px">';
echo '<tr><td>★★★★★★★★★★★★★★★★★★★★★★★<br/></td></tr>';
echo '<tr><td><h1>☆☆>>符合查询结果的台风有<br /></h1></tr></td>';
echo '<tr><td>★★★★★★★★★★★★★★★★★★★★★★★<br/></td></tr>';

while ($row != null) {

    echo '<tr><td><h1>&nbsp;&nbsp;&nbsp;>>序号 : ' . floor($row[0] / 10000) . "年第" . sprintf("%03d", ($row[0] % 10000)) . "号气旋" . '</h1></tr></td>';
    echo '<tr><td><h1>&nbsp;&nbsp;&nbsp;>>名称 : ' . $row[2] . '</h1></tr></td>';
    echo "<tr><td><h1>&nbsp;&nbsp;&nbsp;>>展示 :<a href = \"show.php?num=" . $row[0] . "&count=" . $row[4] . "&table=typhoon_detail\">" . "点击此处进入展示页面" . "</a></h1></tr></td>";
    echo '<tr><td>★★★★★★★★★★★★★★★★★★★★★★★<br/></tr></td>';

    $row = mysqli_fetch_row($result);
}
echo '<tr><td>★★★★★★★★★★★★★★★★★★★★★★★<br/></tr></td></table></center>';

?>

<form action="./index.php">
    <div id="button" align="center">
        <h1>
            <input type="submit" value="返回" class="btn">
        </h1>
    </div>
</form>

</body>
</html>

